]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Don't include keyboard devices when updating lastDevice
authorJonas Dreßler <verdre@v0yd.nl>
Sat, 28 Mar 2020 13:15:09 +0000 (14:15 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Sat, 28 Mar 2020 20:45:32 +0000 (20:45 +0000)
We're dealing with attached keyboards now using the touch_mode property
of ClutterSeat: If a device has a keyboard attached, the touch-mode is
FALSE and we won't automatically show the OSK on touches, also the
touch-mode gets set to FALSE when an external keyboard is being plugged
in, so that also hides the OSK automatically.

With that, we can now ignore keyboard devices when updating the last
used device and no longer have to special-case our own virtual devices.

Because there was no special-case for the virtual device we use on
Wayland now, this fixes a bug where the keyboard disappeared after
touching keys like Enter or Backspace.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2287
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1142

js/ui/keyboard.js

index 8b7f0f895bc879e89d9a2137e5c87da5558b0b07..2cac070db54e21a5a2785e0516f17c55ccf92e65 100644 (file)
@@ -1120,10 +1120,11 @@ var KeyboardManager = class KeyBoardManager {
 
         this._lastDevice = null;
         Meta.get_backend().connect('last-device-changed', (backend, device) => {
-            if (device.get_device_name().indexOf('XTEST') < 0) {
-                this._lastDevice = device;
-                this._syncEnabled();
-            }
+            if (device.device_type === Clutter.InputDeviceType.KEYBOARD_DEVICE)
+                return;
+
+            this._lastDevice = device;
+            this._syncEnabled();
         });
         this._syncEnabled();
     }